﻿/**
 * Created by Administrator on 2017/3/2 0002.
 */
var Page7={
    create:function () {
    var page={};
        page.ui=new PIXI.DisplayObjectContainer();
        var bg=Easy.CreateSprite('assets/images/page_bg.png',0,0,0,0,1);
        page.ui.addChild(bg);

        var i0=Easy.CreateSprite('assets/images/p7_i0.png',370,597,0.5,0.5,0);
        page.ui.addChild(i0);
        var i1=Easy.CreateSprite('assets/images/p7_i1.png',204,398,0.5,0.5,0);
        page.ui.addChild(i1);
        var i2=Easy.CreateSprite('assets/images/p7_i2.png',533,529,0.5,0.5,0);
        page.ui.addChild(i2);
        var i3=Easy.CreateSprite('assets/images/p7_i3.png',204,714,0.5,0.5,0);
        page.ui.addChild(i3);
        var i4=Easy.CreateSprite('assets/images/p7_i4.png',527,880,0.5,0.5,0);
        page.ui.addChild(i4);

        // i1.scale.x=i1.scale.y=0.9;
        // TweenMax.to(i1.scale,1,{repeat:-1,yoyo:true,repeatDelay:0,x:1.1,y:1.1,ease:Cubic.easeInOut})

        var t0=Easy.CreateSprite('assets/images/p7_t0.png',275,100,0.5,0.5,0);
        page.ui.addChild(t0);
        var t1=Easy.CreateSprite('assets/images/p7_t1.png',399-30,240,0.5,0.5,0);
        page.ui.addChild(t1);
        var t2=Easy.CreateSprite('assets/images/p7_t2.png',177,542,0.5,0.5,0);
        page.ui.addChild(t2);
        var t3=Easy.CreateSprite('assets/images/p7_t3.png',507,679,0.5,0.5,0);
        page.ui.addChild(t3);
        var t4=Easy.CreateSprite('assets/images/p7_t4.png',170,861,0.5,0.5,0);
        page.ui.addChild(t4);
        var t5=Easy.CreateSprite('assets/images/p7_t5.png',470,1015,0.5,0.5,0);
        page.ui.addChild(t5);

        var tip=Easy.CreateSprite('assets/images/tip.png',370,1105,0.5,0.5,1);
        TweenMax.to(tip,1,{repeat:-1,yoyo:true,y:1105+30,alpha:0.7,ease:Cubic.easeInOut});
        page.ui.addChild(tip);

        var bt_locate=Easy.CreateSprite('assets/images/bt_locate.png',pixiStage.x+740,1020,1,0.5,1);
        bt_locate.interactive=true;
        page.ui.addChild(bt_locate);
        bt_locate.on('pointerdown',function()
        {
            showMap();
        });

        page.In=function () {
            i0.alpha=0;
            TweenMax.to(i0,1.5,{delay:0.2*0,alpha:1});

            t0.x=275+100;
            t0.alpha=0;
            TweenMax.to(t0,1,{delay:0.3*0,x:275,alpha:1,ease:Cubic.easeInOut});
            t1.alpha=0;
            TweenMax.to(t1,1,{delay:0.3*1,alpha:1,ease:Cubic.easeInOut});

            i1.y=398-60;
            i1.alpha=0;
            TweenMax.to(i1,1.5,{delay:0.2*2-0.1,y:398,alpha:1,ease:Cubic.easeInOut});
            i2.y=529-60;
            i2.alpha=0;
            TweenMax.to(i2,1.5,{delay:0.2*3-0.1,y:529,alpha:1,ease:Cubic.easeInOut});
            i3.y=714-60;
            i3.alpha=0;
            TweenMax.to(i3,1.5,{delay:0.2*4-0.1,y:714,alpha:1,ease:Cubic.easeInOut});
            i4.y=880-60;
            i4.alpha=0;
            TweenMax.to(i4,1.5,{delay:0.2*5-0.1,y:880,alpha:1,ease:Cubic.easeInOut});

            t2.alpha=0;
            t2.y=542+60;
            TweenMax.to(t2,1,{delay:0.2*2,y:542,alpha:1,ease:Cubic.easeOut});
            t3.alpha=0;
            t3.y=679+60;
            TweenMax.to(t3,1,{delay:0.2*3,y:679,alpha:1,ease:Cubic.easeOut});
            t4.alpha=0;
            t4.y=861+60;
            TweenMax.to(t4,1,{delay:0.2*4,y:861,alpha:1,ease:Cubic.easeOut});
            t5.alpha=0;
            t5.y=1015+60;
            TweenMax.to(t5,1,{delay:0.2*5,y:1015,alpha:1,ease:Cubic.easeOut});


        }
        page.Out=function()
        {
            TweenMax.killTweensOf(t0);
            TweenMax.killTweensOf(t1);
            TweenMax.killTweensOf(t2);
            TweenMax.killTweensOf(t3);
            TweenMax.killTweensOf(t4);
            TweenMax.killTweensOf(t5);
            TweenMax.killTweensOf(i0);
            TweenMax.killTweensOf(i1);
            TweenMax.killTweensOf(i2);
            TweenMax.killTweensOf(i3);
            TweenMax.killTweensOf(i4);

            TweenMax.to(page.ui,0.3,{alpha:1,onComplete:function () {
                page.ui.alpha=1;
                i0.alpha=0;
                i1.alpha=0;
                i2.alpha=0;
                i3.alpha=0;
                i4.alpha=0;
                t0.alpha=0;
                t1.alpha=0;
                t2.alpha=0;
                t3.alpha=0;
                t4.alpha=0;
                t5.alpha=0;
            }})
        }

    return page;
    }
}